var timer = null;

function clickNoAttempted(){
	//   title-icon file
	var videoList = document.getElementsByClassName("title-icon file");
	if(videoList.length > 0){
		var videoItem = videoList[0];
		videoItem.click();
		console.log("现在还有%d个视频未看，现在点击%o", videoList.length, videoItem);
	}
}

function AutoClickModuleSet(IsOpen){
    // 初始化
    if(IsOpen == true){
		timer = window.setInterval(clickNoAttempted,1000*60*2/*2分钟查一次*/);
		console.log("自动点击功能开启");
    }else{
		if(timer){
			// 关掉计时器
			window.clearInterval(timer);
		}
		console.log("自动点击功能关闭");
	}
}